/*
 *    Copyright (c) 2018-2025, cloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: cloud
 */

package com.fuyao.cloud.space.edifice.service;

import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuyao.cloud.common.core.util.R;
import com.fuyao.cloud.space.entity.RoomEdifice;
import com.fuyao.cloud.space.vo.ExcelExportEdificeVO;
import com.fuyao.cloud.space.vo.ExcelImportEdificeVO;
import org.springframework.validation.BindingResult;

import java.util.List;

/**
 * 楼栋管理
 *
 * @author liyue
 * @date 2021-11-12 16:03:22
 */
public interface RoomEdificeService extends IService<RoomEdifice> {

	/**
	 * 楼栋创建方法
	 * @return 楼栋对象
	 */
	R create();

	/**
	 * 查询导出楼栋信息
	 * @param query 查询构造器
	 * @return 楼栋信息
	 */
	List<ExcelExportEdificeVO> listEdifice(QueryWrapper<RoomEdifice> query);

	/**
	 * 栋楼信息导入
	 * @param excelVOList 导入列表
	 * @param bindingResult 绑定返回对象
	 * @return R
	 */
	R importEdifice(List<ExcelImportEdificeVO> excelVOList, BindingResult bindingResult);

	/**
	 * 获取楼栋栋tree
	 * @return tree集合。
	 */
	List<Tree<String>> selectTree();

	/**
	 * 获取树形节点
	 * @return
	 */
	List<TreeNode<String>> getTreeNode();

	/**
	 * 根据父id 查询参数
	 * @param id
	 * @param affiliName
	 * @return
	 */
	List<Long> getTreeParam(Long id, String affiliName);

	/**
	 * 延迟加载的树
	 * @param regionalId 区域id
	 * @return
	 */
	List<Tree<String>> lazyTree(Long regionalId);

	/**
	 * 延迟加载的树
	 * @param regionalId "REGIONAL-ID"
	 * @return
	 */
	List<Tree<String>> lazyTree(String regionalId);

	List<Tree<String>> selectEdificeTree();

	/**
	 * 批量删除
	 * @param ids 楼栋ids集合
	 * @return R
	 */
    R batchDelete(List<Long> ids);
}
